<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('报警信息列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>车牌号码：</label>
                                <input type="text" name="carNum"/>
                            </li>
                            <li>
                                <label>卡口编号：</label>
                                <input type="text" name="bayonetNum"/>
                            </li>
<!--                            <li>-->
<!--                                <label>是否报警：</label>-->
<!--                                <select name="isWarm" th:with="type=${@dict.getType('sys_yes_no')}">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
<!--                                </select>-->
<!--                            </li>-->
                            <li>
                                <label>抓拍时间：</label>
                                <input type="text" class="time-input" placeholder="请选择抓拍时间" name="alarmTime"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="alarm:alarm:add">
                    <i class="fa fa-plus"></i> 添加报警
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="alarm:alarm:edit">
                    <i class="fa fa-edit"></i> 修改报警
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="alarm:alarm:remove">
                    <i class="fa fa-remove"></i> 删除报警
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('alarm:alarm:edit')}]];
        var removeFlag = [[${@permission.hasPermi('alarm:alarm:remove')}]];
        var isWarmDatas = [[${@dict.getType('sys_yes_no')}]];
        var alarmType = [[${@dict.getType('alarm_type')}]];
        var carNumTypeDatas = [[${@dict.getType('car_num_type')}]];
        var xzqhxzqh = [[${@dict.getType('xzqhxzqh')}]];
        var prefix = ctx + "alarm/alarm";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "报警信息",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'alarmId',
                    title: '报警ID',
                    visible: false
                },
                {
                    field: 'carNum',
                    title: '车牌号码'
                },
                {
                    field: 'carNumType',
                    title: '号牌种类',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(carNumTypeDatas, value);
                    }
                },
                {
                    field: 'alarmTime',
                    title: '抓拍时间'
                },
                {
                    field: 'xzqh',
                    title: '行政区域',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(xzqhxzqh, value);
                    }
                },
                {
                    field: 'bayonetNum',
                    title: '卡口编号'
                },
                {
                    field: 'bayonetName',
                    title: '卡口名称'
                },
                {
                    field: 'lanesNum',
                    title: '车道号'
                },
                {
                    field: 'alarmType',
                    title: '报警类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(alarmType, value);
                    }
                },
                {
                    field: 'isWarm',
                    title: '是否报警',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(isWarmDatas, value);
                    }
                    ,visible: false
                }
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>